﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CategoryAdmin.aspx.cs" Inherits="Admin_CategoryAdmin" %>

<%@ Register Assembly="msgBox" Namespace="BunnyBear" TagPrefix="cc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h1>
            BookStore Category Admin</h1>
        <div>
            <span>Category Name</span>
            <asp:TextBox ID="txtCategoryNameAdd" runat="server"></asp:TextBox>
        </div>
        <div>
            <asp:Button ID="btnAddCategory" runat="server" Text="Add" OnClick="btnAddCategory_Click" />
        </div>
    </div>
    <h2>
        Book Category List<asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="BookStoreDataContext"
            EntityTypeName="" TableName="items" EnableDelete="True" EnableInsert="True" EnableUpdate="True">
        </asp:LinqDataSource>
    </h2>
    <asp:GridView ID="grvCategories" runat="server" AutoGenerateColumns="False" AutoGenerateDeleteButton="True"
        AutoGenerateEditButton="True" DataKeyNames="category_id" OnRowDeleting="grvCategories_RowDeleting"
        OnRowEditing="grvCategories_RowEditing" 
        OnSelectedIndexChanged="grvCategories_SelectedIndexChanged" 
        onrowupdating="grvCategories_RowUpdating">
        <Columns>
           
            <asp:TemplateField HeaderText="Category Name">
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%#Eval("name")%>' />
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="Label1" runat="server" Text='<%#Eval("name")%>' />
                </EditItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    </form>
</body>
</html>
